Skip to content

feat/read truvera api configs from data store - #565

Merged
maycon-mello merged 3 commits into
masterfrom
feat/read-truvera-api-configs-from-data-store
Jul 28, 2026
Merged

feat/read truvera api configs from data store#565
maycon-mello merged 3 commits into
masterfrom
feat/read-truvera-api-configs-from-data-store

Conversation

@maycon-mello

Copy link
Copy Markdown
Collaborator

No description provided.

@maycon-mello
maycon-mello force-pushed the feat/read-truvera-api-configs-from-data-store branch from ad596ac to 87d0a70 Compare July 27, 2026 16:35
@maycon-mello
maycon-mello requested a review from Copilot July 27, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors delegatable revocation configuration to be provided as a single truveraApi config object (and to be read from the wallet data store in the delegation offer flow), rather than passing separate sponsor key + API URL fields around.

Changes:

  • Added truveraApi to DataStoreConfigs for centralized Truvera API config storage.
  • Introduced TruveraApiConfigs and updated RevocationContext to use it, updating call sites and tests accordingly.
  • Wired delegation offer issuance to pass revocation context sourced from wallet.dataStore.configs.truveraApi.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/data-store/src/types.ts Adds truveraApi to persisted/constructed data store configs.
packages/core/src/delegation/delegation-revocation.ts Refactors revocation context shape to use a truveraApiConfigs object.
packages/core/src/delegation/delegation-offer.ts Passes revocation context from wallet.dataStore.configs.truveraApi into delegated issuance flow.
packages/core/src/delegation/delegation-issuance.ts Makes delegated issuance optionally allocate status entries based on presence of Truvera API configs.
integration-tests/delegatable-revocation.test.ts Updates integration test setup to the new truveraApiConfigs shape.
Comments suppressed due to low confidence (2)

packages/core/src/delegation/delegation-revocation.ts:105

  • The assertion message and validation in postRevocation are outdated after the config refactor: it checks truveraApiConfigs but the error message still mentions truveraApiSponsorKey, and it doesn't validate required fields (authKey, apiUrl). This can lead to confusing errors later (e.g., building a URL with undefined).
  assert(!!ctx.truveraApiConfigs, 'truveraApiSponsorKey is required');
  const jwt = await signRevocationJWT(ctx, {registryId, ...body});

packages/core/src/delegation/delegation-offer.ts:380

  • New behavior is introduced here (building revocationContext from wallet.dataStore.configs.truveraApi and passing it into delegated issuance), but there’s no test coverage asserting that the handler includes revocation context when configs are present (and omits it when absent). Adding a unit test around DELEGATION_REQUEST_HANDLER (or an integration test for the offer->issue flow) would prevent regressions in the config plumbing.
      revocationContext: {
        wallet,
        truveraApiConfigs: wallet.dataStore.configs.truveraApi,
        issuerDID: delegationOffer.issuerDID || issuerDID,
      },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/delegation/delegation-revocation.ts
Comment thread packages/core/src/delegation/delegation-offer.ts
mike-parkhill
mike-parkhill previously approved these changes Jul 27, 2026
@maycon-mello
maycon-mello merged commit c76f686 into master Jul 28, 2026
7 checks passed
@maycon-mello
maycon-mello deleted the feat/read-truvera-api-configs-from-data-store branch July 28, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants